<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');

class Ajax extends Admin_Controller {

	public function __construct()
	{
		parent::__construct();
	}
	
	// ------------------------------------------------------------------------
	
	public function list_website_product_categories($site_code = '')
	{
		if ($this->input->is_ajax_request())
		{
			if ($site_code)
			{
				$this->load->model('content_model');
				$data = $this->content_model->list_product_categories(NULL, '', '', array('c.site_code' => $site_code), '*', TRUE);
				
				$this->response(TRUE, 'custom', $data);
			}
			
			return;
		}
		
		show_404();
	}
	
	// ------------------------------------------------------------------------
	
	public function list_website_product_labels($site_code = '')
	{
		if ($this->input->is_ajax_request())
		{
			if ($site_code)
			{
				$this->load->model('content_model');
				$data = $this->content_model->list_product_labels(NULL, '', 'name', array('pc.site_code' => $site_code), '*', TRUE);
				
				$this->response(TRUE, 'custom', $data);
			}
			
			return;
		}
		
		show_404();
	}
	
	// ------------------------------------------------------------------------
	
	public function list_products($site_code = '')
	{
		if ($this->input->is_ajax_request())
		{
			if ($site_code)
			{
				$this->load->model('content_model');
				$data = $this->content_model->list_products(NULL, '', 'name', array('pc.site_code' => $site_code), '*', TRUE);
				
				$this->response(TRUE, 'custom', $data);
			}
			
			return;
		}
		
		show_404();
	}
	
	// ------------------------------------------------------------------------
	
	

}

/* End of file ajax.php */
/* Location: ./application/controllers/ajax.php */